public class Cargo {
    private final Dimensions dimensions;
    private final double weight;
    private final String address;
    private final boolean turnoverable;
    private final String id;
    private final boolean fragile;

    public Cargo(Dimensions dimensions,
                 double weight,
                 String address,
                 boolean turnoverable,
                 String id,
                 boolean fragile) {
        this.dimensions = dimensions;
        this.weight = weight;
        this.address = address;
        this.turnoverable = turnoverable;
        this.id = id;
        this.fragile = fragile;
    }

    public Dimensions getDimensions() {
        return dimensions;
    }

    public double getWeight() {
        return weight;
    }

    public String getAddress() {
        return address;
    }

    public boolean isTurnoverable() {
        return turnoverable;
    }

    public String getId() {
        return id;
    }

    public boolean isFragile() {
        return fragile;
    }

    public Cargo setAddress(String address) {
        return new Cargo(dimensions, weight, address, turnoverable, id, fragile);
    }

    public Cargo setDimensions(Dimensions dimensions) {
        return new Cargo(dimensions, weight, address, turnoverable, id, fragile);
    }

    public Cargo setWeight(double weight) {
        return new Cargo(dimensions, weight, address, turnoverable, id, fragile);
    }

    public void print() {
        System.out.println("Размеры: " +
                getDimensions().getWidth() + " " +
                getDimensions().getHeight() + " " +
                getDimensions().getLength());
        System.out.println("Вес: " + getWeight());
        System.out.println("Адрес: " + getAddress());
        System.out.println("Можно переворачивать: " + isTurnoverable());
        System.out.println("Регистрационный номер: " + getId());
        System.out.println("Хрупкий: " + isFragile());
    }
}
